package com.zyg.dao;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.zyg.pojo.Grade;
import com.zyg.pojo.Cladd;
import org.apache.ibatis.annotations.*;

import java.util.List;

public interface CladdMapper extends BaseMapper<Cladd> {

    @Override
    @Select("select cladd_id,cladd_name,grade_id from sys_cladd ${ew.customSqlSegment}")
    @Results({
            @Result(property = "claddId", column = "cladd_id"),
            @Result(property = "claddName", column = "cladd_name"),
            @Result(property = "grade", column = "grade_id", javaType = Grade.class,
                    one = @One(select = "com.zyg.dao.GradeMapper.selectById"))
    })
    List<Cladd> selectList(IPage<Cladd> page, @Param(Constants.WRAPPER)Wrapper<Cladd> queryWrapper);
}